
create  table  jms_dm.dm_site_wrong_sum_dt
(
    date_time             date comment '日期',
    taking_site_code     varchar(500) comment '揽收网点code',
    taking_site_name      varchar(500) comment '揽收网点name',  
    agent_code             varchar(500) comment '代理区code',
    agent_name       varchar(500) comment '代理区name',
    fran_code            varchar(500) comment '加盟商编码',
    fran_name             varchar(500) comment '加盟商名称',
    total_num          bigint comment '网点总量',
    wrong_num   bigint comment '始发中心name'
)ENGINE = OLAP
DUPLICATE KEY( date_time,taking_site_code)
COMMENT "网点错分汇总"
PARTITION BY RANGE(date_time)
(START ("2023-03-01") END ("2023-04-25") EVERY (INTERVAL 1 day)
)
DISTRIBUTED BY HASH(taking_site_code,agent_code) BUCKETS 4
PROPERTIES (
"replication_num" = "3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-180",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "4",
"in_memory" = "false",
"storage_format" = "V2"
)
;
